/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.close.visitor.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hopes.bizz.close.common.constant.enums.ParkCloseModDictEnum;
import com.hopes.bizz.close.common.constant.enums.ParkCloseSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 人员进出台账
 *
 * @author pig
 * @date 2023-10-29 21:01:05
 */
@Data
@TableName(value = "closed_person_record", excludeProperty = "tenantId")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "人员进出台账")
public class ClosedPersonRecordEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;


	/**
	* ID
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="ID")
    private Long id;

	/**
	 * 到访企业
	 */
	@Schema(description="到访企业")
	private Long orgId;

	/**
	* 人员Id
	*/
    @Schema(description="人员Id")
    private Long personId;

	/**
	* 姓名
	*/
    @Schema(description="姓名")
    private String name;

	/**
	* 手机号
	*/
    @Schema(description="手机号")
    private String phone;

	/**
	* 身份证
	*/
    @Schema(description="身份证")
    private String idNum;

	/**
	* 人员类型
	*/
    @Schema(description="人员类型")
    private Integer personType;

	/**
	* 门禁ID
	*/
    @Schema(description="门禁ID")
    private Long accessId;

	/**
	* 图片
	*/
    @Schema(description="图片")
    private String personPicUrl;

	/**
	* 进出时间
	*/
    @Schema(description="进出时间")
    private Date inOutTime;

	/**
	* 进出方式
	*/
    @Schema(description="进出方式")
    private String inOutMethod;

	/**
	* 方向
	*/
    @Schema(description="方向")
    private Integer direction;

    public String getOrgIdStr() {
    	return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
	}

	public String getPersonTypeStr() {
    	return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_person_type, this.getPersonType());
	}

	public String getAccessIdStr() {
    	return DictResolver.getItemLabelByValue(ParkCloseModDictEnum.closed_access_control, this.getAccessId());
	}

	public String getDirectionStr() {
    	return DictResolver.getItemLabelByValue(ParkCloseSysDictEnum.close_visitor_record_direction_type, this.getDirection());
	}

}
